import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import comDate from './modules/comDate.js'
import user from './modules/user.js'
// 8月26 新增需求 EMS 改版
import newEms from './modules/newEms.js'
Vue.use(Vuex)
const store = new Vuex.Store({
  getters: {
  },
  modules: {
    comDate: comDate,
    user: user,
    newEms: newEms
  },
  plugins: [createPersistedState({
    storage: window.sessionStorage,
    reducer (val) {
      return {
        // 只存储state 中的user
        user: val.user,
        newEms: val.newEms
      }
    }
  })]
})
export default store
